package com.example.flightsearch.data

import androidx.room.Dao
import androidx.room.Query
import kotlinx.coroutines.flow.Flow

@Dao
interface AirportDao {
    @Query("SELECT * FROM airport WHERE iata_code = :code")
    fun getAirportByCode(code: String): Flow<Airport>

    @Query("select * from airport where iata_code != :code")
    fun getAirportByNotCode(code: String): Flow<List<Airport>>

    @Query("SELECT * FROM airport WHERE iata_code LIKE :name OR name LIKE :name")
    fun getAirportByCodeOrName(name: String): Flow<List<Airport>>
}